package com.lagou.es_springcloud.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

@AllArgsConstructor
@NoArgsConstructor
@Data
@ToString
@Document(indexName = "lagou", type = "product", shards = 3, replicas = 1)
public class Products {
    @Id
    private int id;
    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String name;
    @Field(type = FieldType.Double)
    private double price;
    @Field(type = FieldType.Keyword)
    private String flag;
    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String goods_Desc;
    @Field(type = FieldType.Keyword)
    private String images;
    @Field(type = FieldType.Integer)
    private int goods_Stock;
    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String goods_Type;
}
